﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="Lian.WebForm3" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <img src="yiban/CaptchaHandler.ashx" class="captcha" />
            <a class="PictureIma">看不清？换一张</a>
            <asp:Button ID="Button1" runat="server" Text="验证" OnClick="Button1_Click" />
        </div>
    </form>
</body>
<script src="Scripts/jquery-3.4.1.min.js"></script>
    <script type="text/javascript">
        // 图形验证码点击刷新
        
        var captcha = $(".captcha");
        var captchaSrc = captcha.attr('src')
        captcha.on('click', function () {
            
            $(this).attr('src', captchaSrc + '?r=' + Math.random());
        })
        $(".PictureIma").click(function () {
            $(this).attr('src', captchaSrc + '?r=' + Math.random());
        })
    </script>
</html>
